package com.openthinks.joyniproject.utils;

import com.openthinks.joyniproject.DataLoader;
import com.openthinks.joyniproject.utils.spring.ApplicationCtx;
import com.openthinks.joyniproject.utils.spring.ApplicationCtxInit;

public class Init {

	private static boolean flag = true;
	
	public static boolean mvcInitFinish = false;
	
	public static boolean springInitFinish = false;
	
	public static void init() {
	
		if (flag && mvcInitFinish && springInitFinish) {
			Config.setRootPath(ApplicationCtxInit.getSc().getRealPath("/"));
			SQLConfigLoader.init();
			ApplicationCtx.ctx.getBean(DataLoader.class).init();
			flag = false;
		} 
	}
}
